package net.maku.events.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import net.maku.events.dao.ActivityBriskWalkDao;
import net.maku.events.entity.ActivityBriskWalkEntity;
import net.maku.framework.common.utils.DateUtils;
import net.maku.framework.mybatis.service.impl.BaseServiceImpl;
import net.maku.events.entity.UserJourneyEntity;
import net.maku.events.vo.UserJourneyVO;
import net.maku.events.dao.UserJourneyDao;
import net.maku.events.service.UserJourneyService;
import net.maku.framework.security.user.SecurityUser;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;

/**
 * 用户行程
 *
 * @author 阿沐 babamu@126.com
 * @since 1.0.0 2025-03-22
 */
@Service
@AllArgsConstructor
public class UserJourneyServiceImpl extends BaseServiceImpl<UserJourneyDao, UserJourneyEntity> implements UserJourneyService {


    @Override
    public List<UserJourneyVO> list(Long walkActivityId) {
        return BeanUtil.copyToList(baseMapper.selectList(new LambdaQueryWrapper<UserJourneyEntity>().eq(UserJourneyEntity::getUserId, SecurityUser.getUserId())
                .eq(UserJourneyEntity::getWalkActivityId, walkActivityId)), UserJourneyVO.class);
    }

}